<script type="text/html" template
        lay-url="{{ window.globalConfig.url_caseCategory + '/' + layui.router().search.id }}"
        lay-done="layui.data.done(d);">
    <title>分类详情</title>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <a href="javascript:history.back()"
                           class="layui-btn layui-btn-primary layui-btn-sm" id="goBack">返回上级</a>
                        {{ d.data.name }}
                    </div>
                    <div class="layui-card-body">
                        <div class="layui-form" lay-filter="LAY-home-casesCategory-listform"
                             id="LAY-home-casesCategory-listform"
                             style="padding: 20px 30px 0 0;">
                            <div class="layui-form-item">
                                <label class="layui-form-label">分类名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name" value="{{ d.data.name || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入分类名称" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>

<!--                            <div class="layui-form-item">-->
<!--                                <label class="layui-form-label">图标</label>-->
<!--                                <div class="layui-input-block">-->
<!--                                    <div class="layui-upload-list" id="ID-upload-cases-icon-btn">-->
<!--                                        <img-->
<!--                                                {{# if(d.data.icon){ }}-->
<!--                                                src="{{ window.globalConfig.img_bind_url + d.data.icon}}"-->
<!--                                                {{# } else { }}-->
<!--                                                src="./res/style/imgs/upload.png"-->
<!--                                                {{# } }}-->

<!--                                                id="ID-upload-cases-icon-img" style="max-width: 200px;background-color: #999"-->
<!--                                                class="layui-upload-img">-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                                <input type="hidden" name="icon" id="icon" value="{{ d.data.icon }}">-->
<!--                            </div>-->

                            <div class="layui-form-item">
                                <label class="layui-form-label">封面图片</label>
                                <div class="layui-input-block">
                                    <div class="layui-upload-list" id="ID-upload-casesCategory-btn">

                                        <img
                                                {{# if(d.data.pic){ }}
                                                src="{{ window.globalConfig.img_bind_url + d.data.pic}}"
                                                {{# } else { }}
                                                src="./res/style/imgs/upload.png"
                                                {{# } }}

                                                id="ID-upload-casesCategory-img" style="max-width: 200px"
                                                class="layui-upload-img">
                                    </div>
                                </div>
                                <input type="hidden" name="pic" id="photo" value="{{ d.data.pic }}">
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">是否显示</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="is_show" title="开启|关闭" value="1" lay-skin="switch"
                                           {{# if(d.data.is_show){d.data.is_show=1} }}
                                           {{# if(d.data.is_show){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">排序</label>
                                <div class="layui-input-inline">
                                    <input type="number" name="sort" lay-affix="number" min="0"
                                           value="{{ d.data.sort | 0 }}"
                                           lay-verify="required|number" placeholder="请输入排序" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>
                            <!--  描述  -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">描述</label>
                                <div class="layui-input-inline">
                                    <textarea name="desc" lay-verify="required"
                                              style="width: 400px; height: 150px;"
                                              autocomplete="off"
                                              class="layui-textarea"
                                              placeholder="请输入描述">{{ d.data.desc || '' }}
                                    </textarea>

                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">自定义URL</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="rewrite_url" id="rewrite_url" value="{{ d.data.rewrite_url || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入自定义URL" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>


                            <!--        <input type="hidden" name="content" id="editor-content" value="{{ d.params.content }}">-->
                            <input type="hidden" name="id" value="{{ d.data.id }}">
                            <div class="layui-form-item">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-inline">
                                    <input type="button" lay-submit
                                           lay-filter="LAY-home-casesCategory-listform-submit"
                                           value="保存"
                                           class="layui-btn">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<script src="res/modules/casesCategory.js"></script>
